<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JQuery</title>
    <!-- 引入外部js文件 -->
    <script src="js/jquery-1.8.3.js"></script>
    <script>
        // $(document).ready(function() {
        //     alert("你好，李焕英");
        // });
        // document.getElementById();
        // document.getElementsByName();
        // document.getElementsByTagName();

        var images;

        function preloadimages() {
            images = new Array('eat.png', 'pig.png');
            for (var i = 0; i < images.length; i++) {
                var img = new Image();
                img.src = images[i];
            }
        }

        function over(index) {
            console.log(1);
            document.images[index].src = images[index + 1];
        }
    </script>
</head>

<body onload="preloadimages()">
    <img src="eat.png" alt="" onmouseover="over(0)" width="200" height="200">
</body>

</html>